package com.sxt.demo.djiapplication.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.sxt.demo.djiapplication.entity.WayPointRecord;
import com.sxt.demo.djiapplication.entity.WayPointRecordItem;
import com.sxt.demo.djiapplication.entity.flightdata.FlightData;

import com.sxt.demo.djiapplication.dao.WayPointRecordDao;
import com.sxt.demo.djiapplication.dao.WayPointRecordItemDao;
import com.sxt.demo.djiapplication.dao.FlightDataDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig wayPointRecordDaoConfig;
    private final DaoConfig wayPointRecordItemDaoConfig;
    private final DaoConfig flightDataDaoConfig;

    private final WayPointRecordDao wayPointRecordDao;
    private final WayPointRecordItemDao wayPointRecordItemDao;
    private final FlightDataDao flightDataDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        wayPointRecordDaoConfig = daoConfigMap.get(WayPointRecordDao.class).clone();
        wayPointRecordDaoConfig.initIdentityScope(type);

        wayPointRecordItemDaoConfig = daoConfigMap.get(WayPointRecordItemDao.class).clone();
        wayPointRecordItemDaoConfig.initIdentityScope(type);

        flightDataDaoConfig = daoConfigMap.get(FlightDataDao.class).clone();
        flightDataDaoConfig.initIdentityScope(type);

        wayPointRecordDao = new WayPointRecordDao(wayPointRecordDaoConfig, this);
        wayPointRecordItemDao = new WayPointRecordItemDao(wayPointRecordItemDaoConfig, this);
        flightDataDao = new FlightDataDao(flightDataDaoConfig, this);

        registerDao(WayPointRecord.class, wayPointRecordDao);
        registerDao(WayPointRecordItem.class, wayPointRecordItemDao);
        registerDao(FlightData.class, flightDataDao);
    }
    
    public void clear() {
        wayPointRecordDaoConfig.clearIdentityScope();
        wayPointRecordItemDaoConfig.clearIdentityScope();
        flightDataDaoConfig.clearIdentityScope();
    }

    public WayPointRecordDao getWayPointRecordDao() {
        return wayPointRecordDao;
    }

    public WayPointRecordItemDao getWayPointRecordItemDao() {
        return wayPointRecordItemDao;
    }

    public FlightDataDao getFlightDataDao() {
        return flightDataDao;
    }

}
